﻿using BestCode.Creds.Entities;
using NHibernate.Mapping.ByCode;
using NHibernate.Mapping.ByCode.Conformist;

namespace BestCode.Creds.Data.Mappings
{
    public class LayoutMapping : ClassMapping<Layout>
    {
        public LayoutMapping()
        {
            Table("Layout");
            Id(p => p.Id, map =>
            {
                map.Column("LayoutId");
                map.Generator(Generators.Identity);
            });
            Property(p=> p.X);
            Property(p => p.Y);
            Property(p => p.FontFamily);
            Property(p => p.FontSize);
            Property(p => p.FontWeight);
            Property(p => p.FontDecoration);
            Property(p => p.FieldName);
            Property(p=> p.IsPicturePath);
            Property(p=> p.IsQRCode);
            Property(p => p.IsDisabled);

            Property(p => p.Height);
            Property(p => p.Width);

            Property(p=> p.Color);

            ManyToOne(p => p.Template, map => map.Column("TemplateId"));
            
            
        } 
    }
}
